package com.cxf.rest;

import java.util.LinkedList;
import java.util.List;

public class PersonServiceImpl implements PersonService {

	@Override
	public Person getPersonById(int id) {

		System.out.println("id:" + id);
		
		Person person = new Person();
		
		person.setId(id);
		person.setAge(40);
		person.setName("zhangsan");
		person.setAddress("beijing");
		
		return person;
		
	}

	@Override
	public List<Person> list() {
		
		List<Person> list = new LinkedList<Person>();
		
		Person person1 = new Person();
		person1.setId(1);
		person1.setAge(40);
		person1.setName("zhangsan");
		person1.setAddress("beijing");
		
		Person person2 = new Person();
		person2.setId(2);
		person2.setAge(20);
		person2.setName("lisi");
		person2.setAddress("shanghai");
		
		list.add(person1);
		list.add(person2);
		
		return list;
	}

	@Override
	public List<Person> getPersonByAge(int minAge, int maxAge) {
		System.out.println("minAge : " + minAge + ", maxAge : " + maxAge);
		return list();
	}

}
